Return to doc.sitecore.com

Dealing with Languages
Prev Next

Author: Alexander Shyba
Posted: 6/15/2006 4:52:04 PM

Sitecore 5.3:

To delete a language and all field values for that language in Sitecore 5.3, using the Sitecore Desktop choose Sitecore » Control Panel » Globalization » Delete an Existing Language and complete the wizard. 

 

Problem: rename the content language failed

In case not all fields were updated after renaming the language node the following sql can be used to move the remaining data:

UPDATE UnversionedFields SET Language = 'kl' WHERE Language = 'en'

UPDATE VersionedFields SET Language = 'kl' WHERE Language = 'en'

UPDATE PublishQueue SET Language = 'kl' WHERE Language = 'en'

UPDATE WorkflowHistory SET Language = 'kl' WHERE Language = 'en'

Sitecore 5.1/5.2:

Problem: two English languages

All content languages placed under /system/languages are referenced by the ISO field.

So if you need to have both UK and US English, you would probably need to create two languages with different regional ISO codes in this field (en-US and en-GB).

The problem is that there is already the default English language in the system with the “en” ISO code. So you should run the script to change all occurrences of the “en” language to “en-US” or “en-GB”.

Here is the script:

Update Versions Set [Language] = 'en-US' Where [Language] = 'en'

Update Fields Set [Value] = 'en-US' Where [Value] like 'en'

Update WorkflowHistory Set [Language] = 'en-US' Where [Language] = 'en' 

Problem: rename the content language (change the ISO field value)

Let’s assume that you want to change the ISO code of the existing language, for example, “nl” to “nl-BE”. It is not enough to change the ISO code of the language under system/languages because all the previously created content items will remain in the “nl” language.

The following script should rename the “nl” language for all item versions to “nl-BE”:

Update Versions Set [Language] = 'nl-BE' Where [Language] = 'nl'

Update Fields Set [Value] = 'nl-BE' Where [Value] like 'nl'

Update WorkflowHistory Set [Language] = 'nl-BE' Where [Language] = 'nl' 

Problem: delete the content language

It is not enough to delete the content language from /system/languages because all the previously created content items will remain in the deleted language. To completely delete the content language, run the script given below after the language has been deleted from the client:

delete from versions where [language] = 'en-GB'

delete from fields where [value] like 'en-GB'

delete from workflowHistory where [language] = 'en-GB'

Note: Please back up your databases before any actions are taken. 

 


Prev Next